﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Tarea4
{
    interface ModelInterface : ObservableInterface
    {

        /// <summary>
        /// Initialize (or reset) this model.
        /// </summary>
        /// <param name="sleepInterval">Time interval in miliseconds between next step in non-interactive models</param>
        /// <param name="size">Board size</param>
        /// <param name="row">row coordinate of first element</param>
        /// <param name="col">col coordinate of first element</param>
        void Initialize(int sleepInterval, short [,] initialBoard);

        /// <summary>
        /// Move a cell to the empty place near it (if it exists such empty space).
        /// </summary>
        /// <param name="row">row of the cell to move</param>
        /// <param name="col">column of the cell to move</param>
        /// <returns>Index of the new state reached; -1 if there was no empty space near the cell.</returns>
        int MoveCell(int row, int col);

        /// <summary>
        /// Undo last MoveCell.
        /// </summary>
        /// <returns>The index of the state undone; -1 if the current state could not be undone (i.e. it is the first state).</returns>
        int UnDoMoveCell();

        /// <summary>
        /// Start a previously configured model. Override if model is interactive.
        /// </summary>
        void Start();

        /// <summary>
        /// Pause a running model. Override if model is interactive.
        /// </summary>
        void Pause();

        /// <summary>
        /// Stop a running model. Override if model is interactive.
        /// </summary>
        void Stop();

        /// <summary>
        /// Gets whether this model is running in a non-interactive fashion.
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// Gets whether this model has stopped after running in a non-interactive fashion.
        /// </summary>
        bool IsStopped { get; }

        /// <summary>
        /// Gets whether this model has been paused when running in a non-interactive fashion.
        /// </summary>
        bool IsPaused { get; }

        /// <summary>
        /// Sets/Gets this model's sleep interval between each step, in miliseconds.
        /// </summary>
        int SleepInterval { get; set;}

        /// <summary>
        /// Gets this model's intial board.
        /// </summary>
        short [,] InitialBoard { get; }
    }
}
